<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="score" value=""><br>
    <input type="button" value="输出" onclick="test()"><br>
    <span id="span"></span>
    <script>
        function test()
        {
            var score=parseInt(document.getElementById("score").value)
            // if(score>90)
            // {
            //     document.getElementById("span").innerText="优秀"
            // }
            // else if(score>=80)
            // {
            //     document.getElementById("span").innerText="良好"
            // }
            // else if(score>=60)
            // {
            //     document.getElementById("span").innerText="及格"
            // }
            // else
            // {
            //     document.getElementById("span").innerText="不及格"
            // }
            switch(score/10 && score<=100)
            {
                case 10:
                case 9:
                document.getElementById("span").innerText="优秀"
                break;
                case 8:
                document.getElementById("span").innerText="良好"
                break;
                case 7:
                case 6:
                document.getElementById("span").innerText="及格"
                break;
                default:
                document.getElementById("span").innerText="不及格"
                break;
            }
        }
        
    </script>
</body>
</html>